package net.hserver.admin.system.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hserver.core.ioc.annotation.Autowired;
import cn.hserver.plugin.web.annotation.Controller;
import cn.hserver.plugin.web.annotation.GET;
import cn.hserver.plugin.web.annotation.POST;
import lombok.extern.slf4j.Slf4j;
import net.hserver.admin.system.common.MyResult;
import net.hserver.admin.system.service.CodeService;

/**
 * 代码生成
 *
 */
@Slf4j
@Controller("/code")
public class CodeController {

    @Autowired
    private CodeService service;

    /**
     * 查询表
     *
     */
    @POST("/list")
    public MyResult selectAll() {
        return MyResult.of(service.selectAll());
    }

    /**
     * 代码生成
     */
    @GET("/gen")
    public MyResult gen(String tableName) {
        return MyResult.of(service.genCode(tableName));
    }

}
